home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.eds.co.nz!usenet
- From: Ross Smith <ross.smith@nz.eds.com>
- Subject: Re: pow(-1,1.1) = DOMAIN error
- Content-Type: text/plain; charset=us-ascii
- Sender: usenet@nz.eds.com (Usenet News Admin)
- Content-Transfer-Encoding: 7bit
- Organization: EDS (New Zealand) Ltd
- Message-ID: <312D1DA8.3250@nz.eds.com>
- References: <Christian.Straka.15.0010E3C9@uni-konstanz.de>
- X-Mailer: Mozilla 2.0 (WinNT; I)
- Mime-Version: 1.0
- X-Nntp-Posting-Host: crazy-harry.lab.nz.eds.com
- Date: Fri, 23 Feb 1996 01:51:36 GMT
-
- Christian Straka wrote:
- >
- > The pow() and powl() function in <math.h> doesn't work properly. The following
- > example causes a DOMAIN error exception (see defs in math.h):
- >
- > pow(-1,1.1);
- >
- > Has anyone an idea to fix this problem?
-
- There isn't a problem. -1 to the power of 1.1 *is* an error -- the result
- isn't expressible as a double, because it's a complex number (actually,
- it's a choice of ten different complex numbers).
-
- Mathematically speaking, it should really be a range error rather than a
- domain error, but it's definitely an error.
-
- --
- Ross Smith ........................................ Wellington, New Zealand
- Work: <mailto:ross.smith@nz.eds.com> ... Home: <mailto:alien@netlink.co.nz>
- "Remember when we told you there was no future? Well, this is it."
- -- Blank Reg
-